package com.wangsb.filter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @Description: TODO
 * @author: shenbing.wang@hand-china
 * @date: 2021年02月24日 21:00
 */
@WebFilter("/*")
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("=============执行过滤器链之前=============");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("=============执行过滤器链之后=============");

    }

    @Override
    public void destroy() {

    }
}
